function cmd_init()
	for line in io.lines(conf_dir.."cmds.cfg") do
		local cmd = {}
		for word in string.gmatch(line, "[^%s]+") do
			table.insert(cmd, word)
		end
		local tp = cmd[1]
		local b = cmd[2]
		local t = cmd[3]
		if not b then b = "false" end
		if not t then t = "" end
		if tp and b then
			t = string.sub(line, #tp+#b+2)
		end
		if not (string.lower(b) == "true" or string.lower(b) == "false") and type(b) == "string" then
			t=b
			b = false
		elseif string.lower(b) == "true" then
			b = true
		else
			b = false
		end
		cmd_prefix[tp]={cmd = t, admin = b}
	end
end

function parseCmd(t, priv, a)
	local cmd = {}
	local p = a[1]
	if (type(priv) ~= "boolean") then p = priv; priv = false end
	for word in string.gmatch(t, "[^%s]+") do
		table.insert(cmd, word)
	end
	local typ = string.lower(string.gsub(cmd[1], "_", ""))
	table.remove(cmd, 1)
	if priv then
		if (typ == "login") then
			username = cmd[1]
			password = cmd[2]
			if (users[username]) then
				if (users[username].password == password) then
					admins[p] = users[username].privilege
					msg2(p, "User \""..username.."\" logged in successfully, your privilege mask is \""..admins[p].."\"")
				else
					msg2(p, "User Found but Incorrect Password")
				end
			else
				msg2(p, "No User with the Username: "..username)
			end
		elseif (cmd_priv[typ]) then
			if cmd_priv[typ][admins[p]] then
				local privilege = admins[p]
				command = tableToString(cmd)
				admin_action:act(typ, p, command)
			else
				msg2(p, "You do not have sufficient privilege to use this command")
			end
		elseif not cmd_priv[typ] then
			msg2(p, "Admin command \""..typ.."\' does not exist")
		else
			msg2(p, "You must log in to use this command")
		end
	else
		command = tableToString(cmd)
		action:act(typ, p, command)
	end

end
